luci-app-acl: unset read and write before acl set
authorFlorian Eckert <[email protected]>
Wed, 30 Jun 2021 12:58:14 +0000 (14:58 +0200)
committerFlorian Eckert <[email protected]>
Thu, 1 Jul 2021 06:13:35 +0000 (08:13 +0200)
If the setting in the view is set to `denied`, only the read list option
is deleted. This is not correct. The write list option must also be
deleted. To ensure that the correct configuration is saved, the write
and read list options are always deleted beforehand and then rewritten.

Signed-off-by: Florian Eckert <[email protected]>
applications/luci-app-acl/htdocs/luci-static/resources/view/system/acl.js

index 618facd6e64c45e9d4b2c8ed59319fa1ecea0430..8d1086f754b67cc216f3d76be4ad1679ec3b0ab1 100644 (file)
@@ -146,6 +146,9 @@ var cbiACLSelect = form.Value.extend({
        },
 
        write: function(section_id, value) {
+               uci.unset('rpcd', section_id, 'read');
+               uci.unset('rpcd', section_id, 'write');
+
                if (L.isObject(value) && Array.isArray(value.read))
                        uci.set('rpcd', section_id, 'read', value.read);